//
//  ESTlenService.m
//  adium-tlen
//
//  Created by Krzysztof Godlewski on 22/05/2007.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//


#import <Adium/AIStatusControllerProtocol.h>
#import "ESTlenAccount.h"
#import "ESTlenService.h"

@implementation ESTlenService

// Account Creation
- (Class)accountClass {
	return [ESTlenAccount class];
}


//Service Description
- (NSString *)serviceCodeUniqueID{
	return @"libpurple-Tlen-Pl";
}
- (NSString *)serviceID{
	return @"Tlen.pl";
}
- (NSString *)serviceClass{
	return @"Tlen.pl";
}
- (NSString *)shortDescription{
	return @"Tlen.pl";
}
- (NSString *)longDescription{
	return @"Tlen.pl";
}
- (NSCharacterSet *)allowedCharacters{
	return [NSCharacterSet characterSetWithCharactersInString:@"+-abcdefghijklmnopqrstuvwxyz0123456789@._ "];
}
- (NSCharacterSet *)ignoredCharacters{
	return [NSCharacterSet characterSetWithCharactersInString:@""];
}
- (int)allowedLength{
	return 24;
}
- (BOOL)caseSensitive{
	return YES;
}
- (AIServiceImportance)serviceImportance{
	return AIServiceSecondary;
}

- (void)registerStatuses
{
	[[adium statusController] registerStatus:STATUS_NAME_AVAILABLE
							 withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE]
									  ofType:AIAvailableStatusType
								  forService:self];
	
	[[adium statusController] registerStatus:STATUS_NAME_AWAY
							 withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_AWAY]
									  ofType:AIAwayStatusType
								  forService:self];
	
	[[adium statusController] registerStatus:STATUS_NAME_FREE_FOR_CHAT
							 withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_FREE_FOR_CHAT]
									  ofType:AIAvailableStatusType
								  forService:self];
	
	[[adium statusController] registerStatus:STATUS_NAME_DND
							 withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_DND]
									  ofType:AIAwayStatusType
								  forService:self];
	
	[[adium statusController] registerStatus:STATUS_NAME_EXTENDED_AWAY
							 withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_EXTENDED_AWAY]
									  ofType:AIAwayStatusType
								  forService:self];
	
	[[adium statusController] registerStatus:STATUS_NAME_INVISIBLE
							 withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_INVISIBLE]
									  ofType:AIInvisibleStatusType
								  forService:self];
	
	[[adium statusController] registerStatus:STATUS_NAME_OFFLINE
							 withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_OFFLINE]
									  ofType:AIOfflineStatusType
								  forService:self];	
}

- (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType
{
	NSImage *baseImage = [NSImage imageNamed:@"tlen" forClass:[self class]];
	
	if (iconType == AIServiceIconSmall) {
		baseImage = [baseImage imageByScalingToSize:NSMakeSize(16, 16)];
	}
	
	return baseImage;
}

- (BOOL)canCreateGroupChats
{
	return TRUE;
}

@end
